<template>
  <div class="notic-wrap" style="background-color: #FFFFFF;">
    <a-row>
      <img class="notic-img" src="../../assets/images/swarp-fr.jpg" style="height: 336px" />
    </a-row>
    <div style="width: 1000px;margin: 0px auto;" class="inner">
      <div class="notic-wrap-content">通知公告</div>
      <div class="notic-wrap-content-2">
        <ul>
          <li v-for="(user,index) in beforeNotic" :key="index">
            <h3>
              <img src="../../assets/images/notice/jian  tou@2x.png" />
              <span type="primary" @click="jumpWindow(user.id)">{{user.npMessageTitle}}</span>
            </h3>
            <span class="content">{{user.npPublicContent}}</span>
            <div class="wrap-content-2-footer">
              <span>
                <a-row :gutter="24">
                  <a-col :md="4" :sm="4" style="overflow: hidden;">{{user.createTime.slice(0,10)}}</a-col>
                  <a-col :md="10" :sm="10" style="overflow: hidden;"></a-col>
                  <a-col :md="5" :sm="5" style="overflow: hidden;"></a-col>
                  <a-col :md="3" :sm="4" style="overflow: hidden;color: #38c3c8;" @click="jumpWindow(user.id)" class="pointer">更多详情>></a-col>
                </a-row>
              </span>
            </div>
          </li>
        </ul>
        <a-row>
          <a-col :span="8"></a-col>
          <a-col :span="16">
            <a-pagination
              showSizeChanger
              :pageSize.sync="pageSize"
              @showSizeChange="onShowSizeChange"
              :total="pagelength"
              v-model="current"
              class="page"
            />
          </a-col>
        </a-row>
      </div>
    </div>
    <company-profile style="padding: 20px 0px;background: rgba(235, 238, 245, 1);" />
  </div>
</template>


<script>
import CompanyProfile from '../../components/knowlage/companyProfile'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/zkxhKnowledge'

export default {
  name: 'Beforenotice',
  components: {
    CompanyProfile
  },
  data() {
    return {
      visible: false,
      pageSize: 20,
      current: 1,
      url: {
        list: '/system/sysNoticePublic/list',
        sysNoticePubliclist: '/system/sysNoticePublic/list'
      },
      beforeNotic: [],
      pagelength: 0,
    }
  },
 
  created() {
    getAction(this.url.list).then((res) => {
      if (res.success) {  
        this.beforeNotic = res.result.records
        this.pagelength = this.beforeNotic.length
      }
      if(res.code===510){
        this.$message.warning(res.message)
      }
      this.loading = false;
    })
  },
  methods: {
    onShowSizeChange(current, pageSize) {
      console.log(current, pageSize)
    },
    jumpWindow(itemId) {
      let routeUrl = this.$router.resolve({ path: '/notice/detail',query:{id:itemId}});
      window.open(routeUrl.href, '_blank');
    },
    handleOk(e) {
      console.log(e)
      this.visible = false
    },
    jumpDetail() {
      this.$router.push({
        path: '/beforenotice/noticedetail'
      })
    },
   
  }
}
</script>

<style lang="less" scoped>
@import '~@assets/less/common.less';

* {
  margin: 0;
  padding: 0;
  list-style: none;
}
.notic-wrap {
  width: 100%;
  img {
    width: 100%;
    height: 400px;
  }
}
.notic-wrap-content {
  width: 100%;
  height: 23px;
  margin-top: 24px;
  margin-bottom: 20px;
  font-size: 24px;
  font-family: SimSun;
  font-weight: 400;
  color: #38c3c8;
  line-height: 16px;
  text-align: center;
}
.inner {
  margin-bottom: 20px;
  .notic-wrap-content-2 {
    margin-bottom: 20px;
    .page {
      float: right;
      padding-bottom: 20px;
    }

    ul {
      li {
        width: 100%;
        padding: 20px 0px 30px 0px;
        box-sizing: border-box;
        border-top: 1px solid #ebeef5;
        h3 {
          margin-bottom: 20px;
          text-align: left;
          cursor: pointer;
          img {
            width: 10px;
            height: 8px;
            margin-right: 5px;
          }
          span {
            width: 100%;
            height: 17px;
            font-size: 18px;
            font-family: SimSun;
            font-weight: 400;
            color: #38c3c8;
            line-height: 16px;
          }
        }
        span {
          width: 974px;
          height: 39px;
          font-size: 14px;
          font-family: SimSun;
          font-weight: 400;
          color: rgba(51, 51, 51, 1);
        }
        .content {
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          line-clamp: 2;
          -webkit-box-orient: vertical;
          padding-right: 0;
          margin-right: 0;
        }
      }
    }
  }
}

.wrap-content-2-footer {
  width: 100%;
  justify-content: flex-start;
  align-items: center;

  margin-top: 16px;
  div {
    margin: 0px 10px;
    &:first-child {
      margin-left: 0;
    }
    &:last-child {
      margin-right: 0;
    }
    img {
      width: 14px;
      height: 14px;
      margin-right: 6px;
    }
    span {
      width: 68px;
      height: 10px;
      font-size: 14px;
      font-family: SimSun;
      font-weight: 400;
      color: #999999 !important;
      line-height: 16px;
    }
  }
}
.elastic-frame {
  padding: 20px;
  p {
    padding-top: 20px;
    color: #000;
  }
}
* {
  margin: 0;
  padding: 0;
  list-style: none;
  font-style: SimSun;
  font-weight: Regular;
}

.notic-wrap {
  width: 100%;

  img {
    width: 100%;
    height: 400px;
    background: rgba(255, 255, 255, 1);
  }
}

.notice-detail-wrap {
  p {
    width: 100%;
    font-size: 14px;
    font-family: SimSun;
    font-weight: 400;
    color: #38c3c8;
    line-height: 16px;
    padding: 24px 0px 9px 0px;
    box-sizing: border-box;
    border-bottom: thin solid #ebeef5;
  }

  div {
    width: 100%;
    text-align: center;

    h3 {
      width: 100%;
      height: 22px;
      font-size: 24px;
      font-family: SimSun;
      font-weight: 400;
      color: #333333;
      line-height: 16px;
      text-align: center;
      padding: 20px 0px 31px 0px;
      box-sizing: border-box;
    }

    span {
      width: 100%;
      display: block;
      margin-bottom: 19px;

      em {
        width: 167px;
        height: 12px;
        font-size: 12px;
        font-family: SimSun;
        font-weight: 400;
        font-style: normal;
        color: #333333;

        &:first-child {
          margin-right: 20px;
        }
      }
    }

    content {
      width: 100%;
      display: block;
      text-align: left;
      font-size: 16px;
      color: #333333;
      line-height: 25px;
    }
  }
}

.notice-detail-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  padding: 40px 0px 31px 0px;
}

.notice-detail-footer-left {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  i {
    height: 12px;
    font-size: 12px;
    font-weight: 400;
    color: #333333;
    font-style: normal;
    margin-top: -7px;
  }

  img {
    width: 14px;
    height: 12px;
    margin-left: 10px;
    vertical-align: middle;
  }
}

.notice-detail-footer-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  text-align: right;
  i {
    font-style: normal;
    height: 12px;
    font-size: 12px;
    font-family: SimSun;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    margin-left: 25px;
  }
}
.pointer{
  cursor: pointer;
}
</style>